<div class="alert alert-success"><span class="glyphicon glyphicon-info-sign"></span> 下面地址为商城首页地址，可以复制到其它地方使用。</div>

<form action="" class="form-horizontal" role="form">
  
  <div class="form-group">
    <label class="col-sm-2 control-label">媒体广告地址</label>
    <div class="col-sm-4">
      <input type="text" readonly="readonly" id="url" class="form-control" value="{$adv.url}" datatype="*"/>
      <a href="javascript:void(0)" id="copyUrl">复制接口URL</a>
    </div>
  </div>
  
  <div class="form-group">
    <label class="col-sm-2 control-label">地址二维码</label>
    <div class="col-sm-4">
      <div id="qrcode-url"></div>
    </div>
  </div>
  
</form>

<style type="text/css">
  form:nth-of-type(1) { border-bottom:1px solid #ccc; margin-bottom:20px; }
</style>

<script type="text/javascript" src="__PUBLIC__/Style/Common/js/ZeroClipboard.js"></script>
<script type="text/javascript" src="__PUBLIC__/Style/Common/js/qrcode.min.js"></script>
<script type="text/javascript">
  var qrcode = new QRCode(document.getElementById("qrcode-url"), {
    width : 200,
    height : 200
  });
  qrcode.makeCode( document.getElementById("url").value );
</script>


<script type="text/javascript">
  function actionCallback( data) {
    $("#token").val( data.token );
    $().copyPaste({
      text: $("#token").val(),
      id: "copyToken"
    });
  };
  $().copyPaste({
    text: $("#url").val(),
    id: "copyUrl"
  });
  $().copyPaste({
    text: $("#token").val(),
    id: "copyToken"
  });
</script>
